$(document).ready(function() {
    var urlSite = $('#urlSite').val();

    $('#post-it').click(function() {
	$('.post-it-show').show();
	$(this).hide();
    });
    $('#search-it').click(function() {
	$('.search-it-show').show();
	$(this).hide();
    });
    /* drop down abuse report*/
    $('.abuse-box').modal({
	show: false
    });
    /*
     * send abuse
     */
    $(document).on('click', '.send-abuse', function(e) {
	var link = $(this).attr('link');
	var userId = $(this).attr('user-id');
	var postId = $(this).attr('post-id');
	var text = $(this).parent().parent().find('.select-abusing').val();
	var oBoxReport = $(this).parent().parent();
	$.post(urlSite + 'ad/reportabuse', {link: link, userId: userId, postId: postId, text: text}, function(response) {
	    if (response == 1) {
		oBoxReport.find('.select-abusing').remove();
		oBoxReport.find('.modal-body').append('<div class="alert alert-success"><strong>Congratulation!</strong> You have reported successfully.</div>');
	    }
	});
    });
    $('#resumeBuilder').modal({show: false});
});